package com.example.hotsearchplatform.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * ClassName: Knife4jConfig
 * Package: com.example.transactionhintassistant.config
 * Description:
 *
 */
@Configuration
public class Knife4jConfig {
    @Bean
    public OpenAPI apiInfo() {

        return new OpenAPI()
                .components(new Components()
                        .addSecuritySchemes("Authorization",
                                new SecurityScheme().type(SecurityScheme.Type.HTTP)
                                        .bearerFormat("JWT")
                        )
                )
                .info(new Info()
                        .title("热搜大数据 接口文档")
                        .version("1.0.0")
                        .description("接口文档")
                        .contact(new Contact().name("W").email("1302520892@qq.com"))
                        .license(new License().name("Apache 2.0").url("http://springdoc.org"))
                );
    }
}
